#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#

import time
"""
print(time.time())  # 时间戳1604914089.4224813
print(time.strftime("%Y-%m-%d %H%M%S"))
print(time.strftime("%Y-%m-%d %X"))

# 2020-11-09 173119
# 2020-11-09 17:31:19

print(time.localtime())
print(time.gmtime())

print(time.strftime("%Y-%m-%d %X", time.localtime()))  # 2020-11-10 08:17:54
print(time.strftime("%Y-%m-%d %X", time.gmtime()))  # 2020-11-10 00:17:54

tms = time.strptime('2020-11-08', "%Y-%m-%d")
print(tms) # time.struct_time(tm_year=2020, tm_mon=11, tm_mday=8, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=313, tm_isdst=-1)
print(time.mktime(tms))  # 1604764800.0

print(time.localtime())   # 1604967906.584846
print(time.localtime(time.time()))
# time.struct_time(tm_year=2020, tm_mon=11, tm_mday=10, tm_hour=8, tm_min=25, tm_sec=6, tm_wday=1, tm_yday=315, tm_isdst=0)
print(time.localtime(1604967000))
# time.struct_time(tm_year=2020, tm_mon=11, tm_mday=10, tm_hour=8, tm_min=10, tm_sec=0, tm_wday=1, tm_yday=315, tm_isdst=0)

print(time.strftime("%Y-%m-%d %X", time.localtime(time.time())))  # 2020-11-10 08:28:55
getydy=time.localtime()
print(365-getydy.tm_yday)
"""
print(time.strptime(time.strftime("%Y-%m-%d %X", time.localtime()),'%Y-%m-%d %X'))
print(time.localtime())
# print(time.strftime("%Y-%m-%d %X", time.localtime("2020-11-10 00:00:00")))
print(time.mktime(time.localtime()))
print(time.localtime(1604969222))   # 转换为time.struct_time, 默认是当前时间
